package com.itheima.Homework5;

import java.util.Random;

public class Test08 {
    public static void main(String[] args) {

        int[] arr = {2, 588, 888, 1000, 10000};
        Random r = new Random();
        for (int i = 0; i < arr.length; i++) {
            int a = r.nextInt(5);
            //与-1比较 判断是否已被取出
            if (arr[a] == -1) {
                i--;
            } else {
                //取出元素 并赋值-1
                print(a, arr);
                arr[a] = -1;
            }
        }
    }
    //
    public static void print(int a, int[] arr) {
        System.out.println(arr[a] + "元的奖金被抽出");
    }
}